/* ===== 管理页面公共样式 ===== */

/* 根容器 */
.page-container {
  padding: 24px;
}

/* ===== 页面头部 ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--dbu-space-6);
}

.page-header__content {
  flex: 1;
}

.page-title {
  font-size: var(--dbu-text-2xl);
  font-weight: 600;
  color: var(--dbu-gray-800);
  margin: 0 0 var(--dbu-space-2) 0;
}

.page-description {
  color: var(--dbu-gray-600);
  margin: 0;
  font-size: var(--dbu-text-base);
}

.page-header__actions {
  flex-shrink: 0;
  margin-left: 16px;
}

/* ===== 搜索表单 ===== */
.search-form {
  margin-bottom: 24px;
}

.search-form__content {
  margin: 0;
}

/* ===== 统计卡片 ===== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 简化的颜色类 - 可在全局复用 */
.bg-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.bg-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.bg-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

.bg-pink {
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%) !important;
}

.bg-teal {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important;
}

.bg-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.bg-cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.stat-card__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stat-card__content {
  flex: 1;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dbu-gray-900);
  margin-bottom: 4px;
}

.stat-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--dbu-gray-700);
  margin-bottom: 2px;
}

.stat-card__desc {
  font-size: 12px;
  color: var(--dbu-gray-500);
}

/* ===== 数据表格 ===== */
.data-table {
  background: var(--dbu-bg-primary);
  border-radius: var(--dbu-radius-lg);
  box-shadow: var(--dbu-shadow-sm);
  padding-bottom: var(--dbu-space-6);
  overflow: hidden;
}

/* ===== 表格内容样式 ===== */
.user-info {
  line-height: 1.4;
}

.user-name {
  font-weight: 500;
  color: var(--dbu-gray-900);
}

.user-username {
  font-size: 12px;
  color: var(--dbu-gray-500);
}

.product-info {
  line-height: 1.4;
}

.product-name {
  font-weight: 500;
  color: var(--dbu-gray-900);
}

.product-code {
  font-size: 12px;
  color: var(--dbu-gray-500);
}

.text-muted {
  color: var(--dbu-gray-400);
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--dbu-space-6);
}

/* ===== 对话框 ===== */
.dialog-footer {
  text-align: right;
}

/* ===== 工具类样式 ===== */
/* 表单控件宽度 */
.input--small {
  width: 120px;
}

.input--medium {
  width: 200px;
}

.input--large {
  width: 240px;
}

.input--full {
  width: 100%;
}

/* 布局工具类 */
.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--start {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flex--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 间距工具类 */
.margin-top--small {
  margin-top: var(--dbu-space-2);
}

.margin-top--medium {
  margin-top: var(--dbu-space-3);
}

.padding--small {
  padding: var(--dbu-space-2) var(--dbu-space-3);
  background: var(--dbu-gray-100);
  border-radius: var(--dbu-radius);
  font-size: var(--dbu-text-sm);
  color: var(--dbu-gray-600);
}

/* ===== 响应式设计 ===== */

/* 大屏幕设备 (1200px 以上) */
@media (min-width: 1200px) {
  .stats-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 中等屏幕设备 (768px - 1199px) */
@media (min-width: 769px) and (max-width: 1199px) {
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--dbu-space-5);
  }

  .search-form__content .el-form-item {
    margin-right: var(--dbu-space-3);
  }
}

/* 平板设备 (768px 以下) */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header__actions {
    margin-left: 0;
    margin-top: var(--dbu-space-4);
    width: 100%;
  }

  .page-header__actions .el-button {
    width: 100%;
  }

  .stats-cards {
    grid-template-columns: 1fr;
    gap: var(--dbu-space-4);
  }

  .search-form__content {
    flex-direction: column;
  }

  .search-form__content .el-form-item {
    width: 100%;
    margin-bottom: var(--dbu-space-4);
  }

  .search-form__content .el-form-item__content {
    width: 100%;
  }

  .input--medium,
  .input--large {
    width: 100% !important;
  }

  /* 表格响应式优化 */
  .data-table {
    overflow-x: auto;
  }

  .el-table {
    min-width: 800px;
  }
}

/* 大屏手机设备 (480px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .page-container {
    padding: var(--dbu-space-5);
  }

  .stat-card {
    padding: var(--dbu-space-5);
  }

  .search-form__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--dbu-space-3);
  }

  .search-form__content .el-form-item:last-child {
    grid-column: 1 / -1;
    text-align: center;
  }

  .search-form__content .el-form-item .el-button {
    width: 100%;
  }
}

/* 小屏手机设备 (480px 以下) */
@media (max-width: 480px) {
  .page-container {
    padding: var(--dbu-space-4);
  }

  .stat-card {
    padding: var(--dbu-space-4);
    flex-direction: column;
    text-align: center;
  }

  .stat-card__icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-right: 0;
    margin-bottom: var(--dbu-space-3);
  }

  .stat-card__value {
    font-size: 24px;
  }

  .search-form__content {
    display: block;
  }

  .search-form__content .el-form-item {
    display: block;
    margin-bottom: var(--dbu-space-3);
  }

  .search-form__content .el-form-item__content {
    margin-left: 0 !important;
    width: 100%;
  }

  .search-form__content .el-form-item__label {
    display: block;
    margin-bottom: var(--dbu-space-2);
  }

  /* 对话框响应式 */
  .el-dialog {
    width: 95% !important;
    margin: 5vh auto;
  }

  .el-dialog__header {
    padding: var(--dbu-space-4);
  }

  .el-dialog__body {
    padding: var(--dbu-space-4);
  }

  .el-dialog__footer {
    padding: var(--dbu-space-4);
  }

  .dialog-footer .el-button {
    width: 48%;
    margin: 0 1%;
  }

  /* 表格操作按钮优化 */
  .el-table .el-table__cell .el-button {
    padding: var(--dbu-space-1) var(--dbu-space-2);
    font-size: var(--dbu-text-xs);
  }

  .el-table .el-table__cell .el-button + .el-button {
    margin-left: var(--dbu-space-1);
  }
}

/* 超小屏设备 (360px 以下) */
@media (max-width: 360px) {
  .page-title {
    font-size: var(--dbu-text-xl);
  }

  .page-description {
    font-size: var(--dbu-text-sm);
  }

  .stat-card__title {
    font-size: var(--dbu-text-xs);
  }

  .stat-card__desc {
    font-size: 10px;
  }

  .el-button {
    padding: var(--dbu-space-1) var(--dbu-space-3);
    font-size: var(--dbu-text-xs);
  }

  .el-dialog {
    width: 98% !important;
  }

  /* 表格列宽优化 */
  .el-table .el-table__cell {
    padding: var(--dbu-space-1);
  }
}